<%@page import="com.xnx3.j2ee.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<%@ taglib uri="http://www.xnx3.com/java_xnx3/xnx3_tld" prefix="x" %>
<jsp:include page="/wm/common/head.jsp">
	<jsp:param name="title" value="列表"/>
</jsp:include>

<jsp:include page="/wm/common/list/formSearch_formStart.jsp" ></jsp:include>
	<jsp:include page="/wm/common/list/formSearch_input.jsp">
		<jsp:param name="iw_label" value="手机号"/>
		<jsp:param name="iw_name" value="qishou_phone"/>
	</jsp:include>
	
    <input class="layui-btn iw_list_search_submit" type="submit" value="搜索" />
    
</form>
<div class="tabox" style="padding:0 20px;min-width: 1200px;">
<table class="layui-table iw_table" style="min-width: 1200px;">
  <thead>
    <tr>
    	<th style="width:100px; text-align:center">姓名</th>
        <th style="width:150px; text-align:center">手机号</th>
        <th style="width:200px; text-align:center">请假开始时间</th>
        <th style="width:200px; text-align:center">请假结束时间</th>
        <th style="width:250px; text-align:center">请假原因</th> 
        <th style="width:150px; text-align:center">操作</th>
    </tr> 
  </thead>
  <tbody>
  	<c:forEach items="${list}" var="item">
  		<tr>
  		  <td>${item.qishouUsername}</td>
          <td><x:substring maxLength="25" text="${item.qishouPhone }"></x:substring> </td>
          <td><x:time linuxTime="${item.startTime }" format="yyyy-MM-dd HH:mm"></x:time></td>
          <td><x:time linuxTime="${item.endTime }" format="yyyy-MM-dd HH:mm"></x:time></td>
          <td>${item.reason}</td>
          <td style="width: 100px;">
          <c:choose>
               <c:when test="${item.state == 1}">
	                <botton class="layui-btn layui-btn-sm" onclick="agreeItem(${item.id}, '${item.qishouUsername }');" style="margin-left: 3px;">同意</botton>
	          		<botton class="layui-btn layui-btn-sm" onclick="editItem(${item.id}, '${item.qishouUsername }');" style="margin-left: 3px;">拒绝</botton>
               </c:when>
		  </c:choose>
          		
          </td>
      </tr>
    </c:forEach>
  </tbody>
</table>
</div>
<!-- 通用分页跳转 -->
<jsp:include page="/wm/common/page.jsp"></jsp:include>

<script type="text/javascript">

//同意审核
function agreeItem(id){
	parent.iw.loading("修改中");    //显示“操作中”的等待提示
	$.post("/wangge/qishouleaverecord/argee.json?id="+id, function(data){
	    parent.iw.loadClose();    //关闭“操作中”的等待提示
	    if(data.result == '1'){
			parent.iw.msgSuccess('操作成功');
			location.reload();
	     }else if(data.result == '0'){
			iw.msgFailure(data.info);
	     }else{
			iw.msgFailure();
	     }
	});
}

//拒绝审核
function editItem(id){
	parent.iw.loading("修改中");    //显示“操作中”的等待提示
	$.post("/wangge/qishouleaverecord/refuse.json?id="+id, function(data){
	    parent.iw.loadClose();    //关闭“操作中”的等待提示
	    if(data.result == '1'){
			parent.iw.msgSuccess('操作成功');
			location.reload();
	     }else if(data.result == '0'){
			iw.msgFailure(data.info);
	     }else{
			iw.msgFailure();
	     }
	});
}
</script>

<jsp:include page="/wm/common/foot.jsp"></jsp:include>